package com.example.giftmanger;

import android.content.Context;
import android.util.AttributeSet;
import android.view.animation.AnimationUtils;
import android.view.animation.ScaleAnimation;
import android.view.animation.TranslateAnimation;
import android.widget.RelativeLayout;

//todo:发送礼物的动画
public class GiftView extends RelativeLayout {
    private AnimMessage animMessage;
    //礼物进入动画
    private static TranslateAnimation giftLayoutInAnim;
    //缩放动画
    private static ScaleAnimation iconScalaAnim;
    //用户名飞进来的动画
    private static  TranslateAnimation userNameIn;
    //礼物名飞进来的动画
    private static  TranslateAnimation giftNameIn;

    public GiftView(Context context,AnimMessage message) {
        super(context);
        animMessage=message;
    }



    public GiftView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public GiftView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    //初始化
    private void init(){
        giftLayoutInAnim=(TranslateAnimation) AnimationUtils.loadAnimation(getContext(),
                R.anim.gift_in);
        iconScalaAnim= (ScaleAnimation) AnimationUtils.loadAnimation(getContext(),
                R.anim.icon_scale);

    }
}
